package com.xingren.wms.api.wms.controller;

import com.xingren.common.data.JsonResult;
import com.xingren.service.client.generator.annotation.ApiGenerator;
import com.xingren.service.client.generator.annotation.ClientMetadata;
import com.xingren.v.logging.annotations.Slf4j;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.xingren.wms.api.wms.controller.ModuleRoutes.TEST;
import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8_VALUE;

@RestController
@RequestMapping(produces = APPLICATION_JSON_UTF8_VALUE)
@Validated
@Api(tags = "Wms", description = "Wms API")
@Slf4j(system = "Wms")
@ClientMetadata(projectName = "wms",
        clientConfigClass = "com.xingren.service.wms.client.WmsClientConfig",
        hystrixConfigClass = "com.xingren.service.wms.client.WmsHystrixConfig",
        hystrixCommandConfigMethod = "getDefaultCommandConfig",
        hystrixThreadConfigMethod = "getDefaultThreadConfig"
)
@ApiGenerator
public class WmsController {

    @GetMapping(TEST)
    @ApiOperation("Wms Test")
    public JsonResult<String> test() {
        return JsonResult.ok("1");
    }
}
